import React, {  FC, useContext } from 'react';
import { View, Text } from '@tarojs/components';
import { styled } from 'linaria/react';
import { useClassName } from '@/utils/index';
import { ApplySettledInContext } from '../ApplySettledInContext';
import FormItem from '../_components/FormItem/FormItem';
import Title from '../_components/Title/Title';

export interface IProps extends ICompProps {}
BaseInfo.defaultProps = {} as Partial<IProps>;
function BaseInfo(props: IProps) {
    const { className, style } = props;
    const localClassName = useClassName('BaseInfo', className);
    const {formRules} = useContext(ApplySettledInContext)
    return (
        <RootView className={localClassName} style={style}>
            <Title>基本信息</Title>
            <FormItem
                name="realName"
                label="真实姓名"
                placeholder="请输入你的真实姓名"
                rules={formRules.realName}></FormItem>
            <FormItem
                name="phoneNumber"
                label="手机号"
                placeholder="请输入你真实有效的手机号"
                rules={formRules.phoneNumber}></FormItem>
            <FormItem
                name="qqAccount"
                label="QQ号"
                placeholder="请输入你的QQ号码"
                rules={formRules.qqAccount}></FormItem>
        </RootView>
    );
}
export default React.memo(BaseInfo as FC<IProps>);
const RootView = styled(View)`
    &.BaseInfo {
    }
`;
